<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<style>
    .box{
        width: 100px;height: 100px;
    }
</style>
<body>
    <div id="app">
        <father></father>
    </div>
   
    <template id="father">
        <div>
            <input type="text" v-model="message.value">
            <son :message="message"></son>
        </div>
    </template>

    <template id="son">
        <div>
            <input type="text" v-model="message.value">
        </div>
    </template>
</body>
<script src="./base/vue.js"></script>
<script>
    //Vue/React单向数据流的体现：数据只能从父级组件流向子级组件
    //实现父子间的数据共享，依靠的就是应用类型的地址传递
    Vue.component("father",{
        template:"#father",
        data(){
            return {
                message:{
                    value:"hello!"
                }
            }
        }
    })
    Vue.component("son", {
        template: "#son",
        props:["message"]
    })


    new Vue({
        el:"#app"
    })

</script>
</html>